#ifndef H_RCGD_NTP_H
#define H_RCGD_NTP_H

#define PRECISION (-20)
#define SHMKEY 0x4e545030

#define MSGQid0Path					"/etc/ipc/msgQid0"
#define MSGQid2Path					"/gpsclock/msgQid2"


#define	NTP_LEAP_NOWARNING			0x0	/* normal, no leap second warning */
#define	NTP_LEAP_ADDSECOND			0x1	/* last minute of day has 61 seconds */
#define	NTP_LEAP_DELSECOND			0x2	/* last minute of day has 59 seconds */
#define	NTP_LEAP_NOTINSYNC			0x3	/* overload, clock is free running */

typedef struct{
	int msgQid0;
	
	struct timeval tv_sys;
	struct timeval tv_ext;
	int leapending;
	struct shmTime *shmt;
	
} IPC_;

extern IPC_	IPC;

extern void ntp_time_get(void);
extern void ntp_time_send(void);
extern void ntp_shm_open(void);
extern void ntp_shm_set(void);

#endif
